<?
	require_once("db.php");

	extract($_GET);

	$table	  = strtolower($category);

	$query = "select * from ".$table." where username = '".$user."'";
	$result = mysql_query($query);

	if($result)
	{
		$rows     = mysql_fetch_assoc($result);
		$email    = $rows['email'];
		$id    = $rows['id'];
		$code_cal = crypt($email."rajkot", "rajkotrajkot");
		if($code_cal = $code)
		{
			$query_ins = "insert into login (username, email, category) values ('".$rows['username']."', '".$email."', '".$table."')";
			$result_ins = mysql_query($query_ins);

			$query_up = "update $table set confirm = '1' where id = '$id'";
			$result_up = mysql_query($query_up);
			if($result_up && $result_ins)
			{
				echo "congratulation !!! you have register with rajkot.com !!!";
			}
			else
			{
				echo "problem with database in update query somewhere";
			}
		}
		else
		{
			echo "there is something wrong with encryption but no need to take tension because it is not your fault it is our fault !!!";
		}
	}
	else
	{
		echo "problem in select query, maybe user not found in db or else";
	}


?>
